# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lxqt-openssh-askpass
pkgver=2.0.1
pkgrel=0
pkgdesc="GUI to query passwords on behalf of SSH agents"
url="https://github.com/lxqt/lxqt-openssh-askpass"
arch="all !armhf" # qt5
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools qt6-qtbase-dev
	qt6-qttools-dev liblxqt-dev kwindowsystem-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
options="!check" # No testsuite
source="https://github.com/lxqt/lxqt-openssh-askpass/releases/download/$pkgver/lxqt-openssh-askpass-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/lxqt//translations/$pkgname
}

sha512sums="
57f557b4a4a43e9faca68d90239b271f984cd7a5ee6b11be6ba325c2e3a2cb15f5bebba12bbfbe4caf0930a9b26876b689eda6b1188f203f5d8361a0f785acfd  lxqt-openssh-askpass-2.0.1.tar.xz
"
